package com.star.spring.aop.service;

import com.star.spring.aop.annotation.Log;
import org.springframework.stereotype.Service;

/**
 * @ClassName CalculateServiceImpl
 * @Author star
 * @Date 2024/10/18 11:21
 */

@Service
public class CalculateServiceImpl implements CalculateService{
    @Override
    @Log("this is add method")
    public int add(int a, int b) {
        return a + b;
    }

    @Override
    public int sub(int a, int b) {
        return a - b;
    }

    @Override
    public int mul(int a, int b) {
        return a * b;
    }

    @Override
    public int div(int a, int b) {
        return a / b;
    }

    @Override
    @Log("this is multiAdd method")
    public int multiAdd(int a, int b, int c) {
        int i = 1 / 0;

        return a + b + c;
    }
}
